package com.example.demo.mapper;

import com.example.demo.entiy.Employee;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface EmployeeMapper {
    @Select("select * from Employee where username = #{username}")
    Employee getByUserName(String username);
    @Insert("insert into Employee (`name`,username,`password`,phone,sex,id_number,`status`,create_time,update_time,create_user,update_user) " +
            "VALUES (#{name},#{username},#{password} ,#{phone} ,#{sex} ,#{idNumber} ,#{status} ,#{createTime} ,#{updateTime} ,#{createUser} ,#{updateUser} )")
    void save(Employee employee);


    Page<Employee> pageInfo(int page, int pageSize, String name);

    int charageStatus(Employee employee,Long empId);
    @Select("select * from employee Where id = #{id} ")
    Employee getUser(Long id);
}
